<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            background-color: #0b121b;
        }
        
        a {
            margin: 300px auto;
            width: 400px;
            height: 300px;
            text-decoration: none;
            font-size: 40px;
            line-height: 300px;
            text-align: center;
            display: block;
            position: relative;
            overflow: hidden;
            color: #409eff;
        }

        a:hover {
            background: #409eff;
            color: #fff;
            border-radius: 5px;
            box-shadow: 0 0 35px #409eff;
        }

        a span {
            position: absolute;
            display: block;
        }

        a span:nth-child(1) {
            top: 0;
            left: -100%;
            width: 100%;
            height: 2px;
            background: linear-gradient(90deg, transparent, #409eff);
            animation: line-animate1 1s linear infinite;
        }

        @keyframes line-animate1 {
            0% {
                left: -100%;
            }

            50%,
            100% {
                left: 100%;
            }
        }

        a span:nth-child(2) {
            top: -100%;
            right: 0;
            width: 2px;
            height: 100%;
            background: linear-gradient(180deg, transparent, #409eff);
            animation: line-animate2 1s linear infinite;
            animation-delay: .25s
        }

        @keyframes line-animate2 {
            0% {
                top: -100%;
            }

            50%,
            100% {
                top: 100%;
            }
        }

        a span:nth-child(3) {
            bottom: 0;
            right: -100%;
            width: 100%;
            height: 2px;
            background: linear-gradient(270deg, transparent, #409eff);
            animation: line-animate3 1s linear infinite;
            animation-delay: .5s
        }

        @keyframes line-animate3 {
            0% {
                right: -100%;
            }

            50%,
            100% {
                right: 100%;
            }
        }

        a span:nth-child(4) {
            bottom: -100%;
            left: 0;
            width: 2px;
            height: 100%;
            background: linear-gradient(360deg, transparent, #409eff);
            animation: line-animate4 1s linear infinite;
            animation-delay: .75s
        }

        @keyframes line-animate4 {
            0% {
                bottom: -100%;
            }

            50%,
            100% {
                bottom: 100%;
            }
        }
    </style>
</head>

<body>
    <a href="">
        <span></span>
        <span></span>
        <span></span>
        <span></span>
        CSS炫酷按钮样式
    </a>
</body>

</html>